package cn.neusoft.yuejian307.activity;

import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import cn.neusoft.yuejian307.R;




public class MyTitle extends FrameLayout {
    private ImageView back;
    private TextView textView;
    public MyTitle(Context context, AttributeSet attributeSet) {
        super(context,attributeSet);
        LayoutInflater.from(context).inflate(R.layout.title,this);
        back = (ImageView)findViewById(R.id.back);
        textView =  (TextView)findViewById(R.id.title);
        back.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                ((Activity)getContext()).finish();
            }
        });

    }
    void setTitle(String title){
        textView.setText(title);
    }

}
